<template>
	<div style="">
  <top-nav bgColor="white" title="发送提货码" :isCenterBtn="true"  :rightShow="true" returnPath="上一级" btnName="作废" @fatherDo="unselect" ></top-nav>
  <section style="height: 3rem;"></section>
  <!--<detail-item :billData="detailInfo">
  	
  </detail-item>-->
  
  <section style="width: 100%;display: flex;flex-direction: column;background-color: white;padding:0.4rem 0.6rem;" @click="sendDetailsParam()">
			<section style="justify-content: left;align-items: center;display: flex;flex-direction: row;height: 2.8rem;padding: 0 0.5rem;">
				<span style="text-align: left;font-size: 1.1rem;">过磅编号：{{detailInfo.BillNo}}</span>
				<!--<mu-icon style="flex: 1;" value="keyboard_arrow_right" :size="26"/>-->
			</section>
			<section style="display: flex;flex-direction: column;justify-content: center;justify-content: left;padding: 0 0.5rem;">
				<span  class="card-item-child">客户：{{getDataType(detailInfo.BusinessUnit.Name)}}</span>
				<span class="card-item-child">车牌号：{{detailInfo.CarNumber}}</span>
				<span class="card-item-child">备注：</span>
				<span class="card-item-child">物料：{{detailInfo.ItemName}}</span>
				<span class="card-item-child">提货码：{{detailInfo.PassWord}}</span>
				<span class="card-item-child">预装量：{{detailInfo.PreLoad}}</span>
				<span class="card-item-child">提货方式：自提</span>
			</section>
			
  </section>
  
  
  <mu-table multiSelectable enableSelectAll ref="table" :showCheckbox="false"  style="padding: 0 0.6rem;">
    <mu-thead>
      <mu-tr style="">
        <mu-th style="font-size: 1rem;color:#0090FF;height: 2rem;">订单编号</mu-th>
        <mu-th style="font-size: 1rem;color:#0090FF;height: 2rem;">暂扣量</mu-th>
        <mu-th style="font-size: 1rem;color:#0090FF;height: 2rem;">余量</mu-th>
      </mu-tr>
    </mu-thead>
    <mu-tbody >
      <mu-tr >
        <mu-td style="height: 1.2rem;">10001</mu-td>
        <mu-td>150</mu-td>
        <mu-td>850</mu-td>
      </mu-tr>
    </mu-tbody>
  </mu-table>
  
  <mu-dialog :open="isPop" title="提示" @close="close">
            此操作将作废本次任务单, 是否作废?
    <mu-flat-button slot="actions" @click="close('cancel')" primary label="取消"/>
    <mu-flat-button slot="actions" primary @click="close('sure')" label="确定"/>
  </mu-dialog>
  
  
	</div>
</template>

<script>
import DetailItem from '@/page/project/demo/cardItem/detailItem.vue'
import TopNav from '@/components/nav/topNav.vue'
export default {
  components: {
      TopNav,
      DetailItem
  },
  data(){
  	  return{
  	  		detailInfo:{},
  	  		isPop:false
  	  }
  },
  mounted(){
  	  this.detailInfo=this.$route.params.bill
  	  console.info(this.detailInfo)
  },
  methods: {
  	getDataType(data){
  		console.info(data)
  		var str=''+data
  		return str
  	},
    unselect (data) {
	   this.isPop=true
       let that=this
       
// 	   this.$confirm('此操作将作废本次任务单, 是否作废?', '提示', {
//        confirmButtonText: '确定',
//        cancelButtonText: '取消',
//        center:true,
//        type: 'warning'
//      }).then(() => {
//      		
//      		that.cancleTask()
//      }).catch(() => {        
//     });
    },
    close(val){
    	if(val=='sure'){
    		this.cancleTask()
    	}
    	this.isPop=false
    },
	cancleTask(){
				let that=this
				that.axios.post('/demo/cancleTask',{
					'factoryId':localStorage.factoryId,
					'uid':localStorage.uid,
					'fid':this.$route.params.fid
				}).then(function(response){
					 that.$message({showClose: true,type: 'success',message: '作废成功!',duration:1500})
					 that.$router.push({path:'laddingBills'})
					 
				}).catch(function(error){
					that.$message({showClose: true,type: 'success',message: '作废失败!',duration:1500})
				})
	}
  }
}
</script>

<style>
	.card-item-child{
		text-align: left;
		font-size: 0.9rem;
		height: 1.6rem;
		color: #939393;
	}
</style>